 let plugins = {
    install(Vue) {
		//模糊字符串 start 开始, end 倒数几个
		Vue.prototype.blurStr = function(str,start,end) {
			return str.substring(0,start) + "***" + str.substring(str.length-end);
		}
		//moneyFlag，是否金额，viewType 显示类型，
		Vue.prototype.showTag = function (moneyFlag, viewType) {
			let obj = {}
			if(moneyFlag == '1') {
				obj = {
					lable:'金额',
					unit:'元'
				}
			}else {
				if(viewType == 'water'){
					obj = {
						lable:'水量',
						unit:'吨'
					}
				}else{
					obj = {
						lable:'气量',
						unit:'方'
					}
				}
			}
			return obj;
		}
       
		Vue.filter('dateFormate', function (value) {
            return value.substring(0, 4) + "-" + value.substring(4, 6) + "-" + value.substring(6, 8)+" " + value.substring(8, 10) +":" +value.substring(10, 12)+":"+ value.substring(12,14)
        })
		
		Vue.filter('dFormate', function (value) {
		    return value.substring(0, 4) + "-" + value.substring(4, 6) + "-" + value.substring(6, 8);
		})
		
    }
}

export default plugins